Conversation
| Base.widen(::Type{Dec32}) = Dec64 | ||
| Base.widen(::Type{Dec64}) = Dec128 | ||
|
|
||
| Printf.tofloat(x::DecimalFloatingPoint) = BigFloat(x) |
There was a problem hiding this comment.
Don't we need to pass a precision? Otherwise the BigFloat constructor may use too low a precision.
Why do we need a conversion at all here? Wouldn't it be possible to have Printf.tofloat(x::DecimalFloatingPoint) = x and support printing natively on decimal floating point values? It seems like a shame to do a lossy conversion to binary floating point for printing — kinda defeats the point.
There was a problem hiding this comment.
I would also prefer to not go through BigFloat. In the original Printf PR, there is another interface mentioned where we could pass a buffer of digit chars and the location of the decimal point and have that formatted.
I would like to try that interface but I can't find it in the current code. JuliaLang/julia#32859 (comment) Is that interface implemented @quinnj ?
Fixes #178